import Vue from 'vue'
import App from './App.vue'
import {request} from "./network/request"

Vue.config.productionTip = false

Vue.prototype.$http = request

Vue.directive('foucs',{
  inserted:(el)=>{
    console.log(el)
    el.focus()
  }
})
Vue.directive('postion',{
  // 当自定义指令挂载到DOM中时，会触发该函数
  inserted:(el,binding)=>{
    el.style.position = "fixed";
    console.log(binding)
    el.style.left = binding.value.left + "px"
    el.style.top = binding.value.top + "px"
    el.style.right = binding.value.right + "px"
    el.style.zIndex = binding.value.z
    console.log(binding.modifiers)
    // if(binding.modifiers.stop){
    //   el.stopP()
    // }
  }
})

new Vue({
  render: h => h(App),
}).$mount('#app')
